import AutoImport from "unplugin-auto-import/vite";
import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
import Components from "unplugin-vue-components/vite";

export default defineNuxtConfig({
  modules: ["nuxtjs-naive-ui", "@unocss/nuxt"],
  css: [
    "~/assets/css/main.scss",
    "~/assets/css/animations.css",
    "~/assets/css/responsive.css",
  ],
  // https://github.com/tusen-ai/naive-ui/issues/6804 报错解决方案
  // build: {
  //   transpile: ["vueuc", "naive-ui"],
  // },
  vite: {
    plugins: [
      AutoImport({
        imports: [
          {
            "naive-ui": [
              "useDialog",
              "useMessage",
              "useNotification",
              "useLoadingBar",
            ],
          },
        ],
      }),
      Components({
        resolvers: [NaiveUiResolver()],
      }),
    ],
  },

  compatibilityDate: "2025-03-22",
});
